package is.ru.tgra;

public class SolarSystem {
	
	static int numOfPlanets = 10;
	
	
	
	public static Planet[] createPlanets() {

		

		Planet sun = new Planet(
				new Point3D(1.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				4.0f, //pPlanetSize
				0.0f, //pOrbitSize
				0.0f, //pOrbitSpeed
				"sun.jpg", //texture
				100, 48); 
		
		Planet mercury = new Planet(
				new Point3D(12.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.1f, //pPlanetSize
				0.0f, //pOrbitSize
				1.07f, //pOrbitSpeed
				"mercury.jpeg", //texture
				50,24); 
		
		Planet venus = new Planet(
				new Point3D(14.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.16f, //pPlanetSize
				0.0f, //pOrbitSize
				0.7835f, //pOrbitSpeed
				"Venus.jpg", //texture
				50,24); 
		
		Planet earth = new Planet(
				new Point3D(18.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.2f, //pPlanetSize
				0.0f, //pOrbitSize
				0.663f, //pOrbitSpeed
				"earth.jpg", //texture
				50,24); 
		
		
		Planet moon = new Planet(
				new Point3D(18.0f, 1.0f, 1.6f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.02f, //pPlanetSize
				0.0f, //pOrbitSize
				0.663f, //pOrbitSpeed
				"moon.jpg", //texture
				50, 24); 
		
		Planet mars = new Planet(
				new Point3D(22.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.16f, //pPlanetSize
				0.0f, //pOrbitSize
				0.54f, //pOrbitSpeed
				"mars.jpg", //texture
				50, 24); 
		
		Planet jupiter = new Planet(
				new Point3D(28.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				1.6f, //pPlanetSize
				0.0f, //pOrbitSize
				0.2924f, //pOrbitSpeed
				"jupiter.jpg", //texture
				50, 24); 
		
		Planet saturn = new Planet(
				new Point3D(38.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				1.2f, //pPlanetSize
				0.0f, //pOrbitSize
				0.2164f, //pOrbitSpeed
				"saturn.jpg", //texture
				50, 24); 
		
		Planet uranus = new Planet(
				new Point3D(44.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.4f, //pPlanetSize
				0.0f, //pOrbitSize
				0.1529f, //pOrbitSpeed
				"uranus.jpg", //texture
				50, 24); 
		
		Planet neptune = new Planet(
				new Point3D(46.0f, 1.0f, 1.0f), //pPos (x, y, z)
				new Point3D(0.0f, 2.5f, 0.0f), //pCenter
				new Vector3D(0.0f, 1.0f, 0.0f), //Vector3D up
				0.4f, //pPlanetSize
				0.0f, //pOrbitSize
				0.107f, //pOrbitSpeed
				"neptune.jpg", //texture
				50, 24);
		
		numOfPlanets = 10;
		
		return new Planet[]{sun,mercury,venus,earth,moon,mars,jupiter, saturn, uranus, neptune};
		
	}
	
	public static float findX(float radius, float orbitTime, float speed)
	{
		float deltaDegrees = (float) ((orbitTime * speed/3) % 360.0f);
		
		double x = (1 + radius * Math.cos(deltaDegrees));
		
		return (float)(x);
		
	}
	
	public static float findZ(float radius, float orbitTime, float speed)
	{
		float deltaDegrees = (float) ((orbitTime * speed/3) % 360.0f);
		
		double z = (1+radius * Math.sin(deltaDegrees));
		
		
		return (float)(z);
		
	}
	
	

}
